﻿using System;
using System.Windows;
using System.Windows.Data;
using System.Globalization;

namespace WpfAi.Convert
{
    public class SerialStateConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return DependencyProperty.UnsetValue;
            else
            {
                if ((bool)value)
                    return "关闭串口";
                else
                    return "打开串口";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
